import { sayHello } from './utils/hello'

// 字面量类型 'zhangsan' 18
let name: 'zhangsan' = 'zhangsan'
let age1: 18 = 18

// 报错：不能将类型"19"分配给类型 "18"
// age = 19
console.log(name, age1)

// string类型 和 'Hello TS'字面量类型
let str1 = 'Hello TS'
const str2 = 'Hello TS'


let obj: any = { age: 18 }
obj.bar = 100
// obj()
const n: number = obj

// 声明变量不给类型或初始值 any
let a;
a = 1       // 不报错
a = 'hello' // 不报错

console.log(sayHello('张三'))

const strs = ['a', 'b', 'c']
// 鼠标放在 forEach 上查看类型
strs.forEach